package org.benjamin.lending.configuration;

import javax.servlet.ServletContext;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
import org.springframework.web.filter.CharacterEncodingFilter;

public class LendingSecurityWebInitializer extends AbstractSecurityWebApplicationInitializer{
	
	private Logger logger = LogManager.getLogger();

	@Override
	protected void beforeSpringSecurityFilterChain(ServletContext servletContext) {
		logger.info("加载Spring Security配置信息");
		servletContext.addFilter("characterEncodingFilter", new CharacterEncodingFilter("UTF-8",true)).addMappingForUrlPatterns(null, false, "/*");
	}
	
	

}
